#include<iostream>
#include<string.h>
using namespace std;


void 
reverse1(char *str)
{
	char *p=str;
	if(str)
	{
		while(*p)
			p++;
	}
	p--;
	char tmp;
	while(str<p)
	{
		tmp=*str;
		*str++=*p;
		*p--=tmp;
	}
}

void
reverse2(char* str)
{
	char tmp;
	for(int i=0,j=strlen(str)-1 ; i<j ; i++,j--)
	{
		tmp=str[i];
		str[i]=str[j];
		str[j]=tmp;
	}
}


int main()
{
	char str1[]="abcdefghijklmnopqrstuvwxyz";
	char str2[]="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	reverse1(str1);
	cout<<"str1 : "<<str1<<endl;
	reverse2(str2);
	cout<<"str2 : "<<str2<<endl;
	return 0;
}
